import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    flg:true,
    data:null,
    color:'lightGreen',
  },
  getters: {
    flg: (state) => {
      return state.flg
    },
    data:(state) =>{
      return state.data
    },
    color:(state) => {
      return state.color
    },
  },
  mutations: {
    judge(state){state.flg = !state.flg},
    data(state,msg){state.data = msg},
    color(state,col){state.color = col},
  },
  actions: {
    judge(context){context.commit('judge')},
    data(context,msg){context.commit('data',msg)},
    color(context,col){context.commit('color',col)}
  },
  modules: {
  }
})
